package cn.antsing;

/**
 * 访问者
 */
public class GeneralReport implements IVisitor {
    private int itemNo;
    private int orderNo;
    private int customerNo;
    public void visit(Customer customer) {
        System.out.println("Customer:"+customer.getName());
        itemNo ++;
    }

    public void visit(Order order) {
        System.out.println("Order:"+order.getName());
        orderNo++;
    }

    public void visit(Item item) {
        System.out.println("Item;"+item.getName());
        itemNo++;
    }

    public  void displayResults(){
        System.out.println("Nr of customers:" + customerNo);
        System.out.println("Nr of orders:   " + orderNo);
        System.out.println("Nr of itemss:   " + itemNo);
    }
}
